<?php
	class Show {
		public $module;
		public $method;
		public $file;
		
		public function __construct() {
			if (isset($_GET['do'])) {
				$do = explode('.', $_GET['do']);
			} else {
				$do = explode('.', DEFAULT_DO);
			}
			$this->module = $do[0];
			$this->method = $do[1];
			
			$this->file = F_SOURCE . $this->module . '/' . $this->module . '.ctrl.class.php';
		}
		
		public function execute() {
//			if ($this->ckLogin() == false) {
//				go('index.php');
//			}
			if (file_exists($this->file)) {
				include_once $this->file;
			} else {
				echo 'Not found the file:',$this->file;
				exit();
			}
			$className = $this->module . 'Ctrl';
			if (class_exists($className)) {
				$object = new $className();
				if (method_exists($object, $this->method)) {
					$object->{$this->method}();
				} else {
					echo 'Not found the method:', $this->method, '@',$className;
					exit();
				}
			} else {
				echo 'Not found the class:', $className;
				exit();
			}
		}
	}
?>